<?php 
defined('IN_ADMIN') or exit('No permission resources.');
include $this->admin_tpl('header');
?> 

<script language="javascript" type="text/javascript" src="<?php echo JS_PATH;?>commoncheck.js"></script>
<script language="javascript" type="text/javascript" src="<?php echo JS_PATH;?>open_window.class.js"></script>
<body onload="contactcheck()">
<div class="txt_head_frame">
	<span class="txt_frame_title">修改联系人</span>
</div>
<div id="main_content">
<form name="myform" action="?m=account&c=contactmanage&a=edit" method="post" id="myform">
<input type="hidden" name="info[customer_id]" id="_N_id_" value="<?php echo $customer_id?>"/>
<input type="hidden" name="info[contact_id]" value="<?php echo $contact_id?>" />
<div class="txt_content_frame">
	<div class="txt_content_box">
		<div class="txt_content_left">
			<div class="txt_text_left">联系人名称:<span>[*]</span></div>
			<div class="txt_left_input"><input name="info[contact_name]" type="text" class="txt" id="contact_name" value="<?php echo $contact_name?>"/></div><span id="validatecontact_name" class="validate"></span><br/><br/>
			<div class="txt_text_left">对应客户:<span>[*]</span></div>
			<div class="txt_left_input"><input  type="text" class="txt" disabled="disabled" id="_N_name_" value="<?php echo $customer_name['customer_name']?>"/><a onclick="javascript:Open_window.winOpen(set_ajx_url('index.php?m=account&c=customermanage&a=search'))" href="javascript:void(0)"><img src="images/detail.png"></a></div><br/><br/>
            <div class="txt_text_left">类型:</div>
			<div class="txt_left_input">
            <select name="info[contact_type]" class="select">
            <?php 
            	foreach ($option_cache['contact_type'] as $key => $value) {
            ?>
			<option value="<?php echo $key?>" <?php echo $key == $contact_type ? 'selected' : ''?>><?php echo $value?></option>
			<?php 
            	}
			?>
			</select>
			</div><br/><br/>  
			<div class="txt_text_left">性别:</div>
			<div class="txt_left_input">
			<select name="info[sex]" class="select">
				<option value="1" <?php echo '1' == $sex ? 'selected' : ''?>>男</option>
				<option value="0" <?php echo '0' == $sex ? 'selected' : ''?>>女</option>
			</select></div><br/><br/>
			<div class="txt_text_left">主要业务:</div>
			<div class="txt_left_input"><input name="info[preside]" type="text" class="txt" id="preside" value="<?php echo $preside?>"/></div><span id="validatepreside" class="validate"></span><br/><br/> 
			<div class="txt_text_left">称谓:</div>
			<div class="txt_left_input"><input name="info[appellation]" type="text" class="txt" id="appellation"  value="<?php echo $appellation?>"/></div><span id="validateappellation" class="validate"></span><br/><br/> 
			<div class="txt_text_left">联系电话:</div>
			<div class="txt_left_input"><input name="info[phone]" type="text" class="txt" id="phone" value="<?php echo $phone?>"/></div><span id="validatephone" class="validate"></span><br/><br/>
			<div class="txt_text_left">E-MAIL:</div>
			<div class="txt_left_input"><input name="info[email]" type="text" class="txt" id="email" value="<?php echo $email?>"/></div><span id="validateemail" class="validate"></span><br/><br/>  
		</div>
		<div class="txt_txtarea">
			<div class="txt_txtarea_text">备注：</div>
			<div class="txt_txtarea_input1"><textarea name="info[remark]" cols="50" rows="4" class="txt_txtarea_font"><?php echo $remark?></textarea></div>
		</div>
	</div>
</div>

<div class="txt_btn">
	<input name="dosubmit" type="submit" class="txt_btn_a" value=" 保存 " />
</div>
</form>
</div>
</body>
<script type="text/javascript">
<!--
var Open_window = new Open_window();
function contactcheck(){
	$('#contact_name').blur(function(){
		var validate = $('#validatecustomer_name');
		if(isNotNull($(this).val())){	
			validate.html('<img src="images/true.gif" width=16 heigth=16>');
		} else {
			validate.html('<img src="images/false.gif" width=16 heigth=16>不能为空');	
		}
	});
	$('#email').blur(function(){
		var validateEmail = $('#validateemail');
		if(!is_email($(this).val())){
			validateEmail.html('<img src="images/false.gif" width=16 heigth=16>请输入正确的邮箱');	
		} else {
			validateEmail.html('<img src="images/true.gif" width=16 heigth=16>');		
		}
	});

	$('#phone').blur(function(){
		var validate = $('#validatephone');
		if(isNum($(this).val())){
			validate.html('<img src="images/true.gif" width=16 heigth=16>');
		} else {
			validate.html('<img src="images/false.gif" width=16 heigth=16>请输入正确的电话号码');
		}
	});
}
//-->
</script>
</html>